package com.wk.springboot.tree.comparator;

import com.wk.springboot.tree.bean.Person;

import java.util.Comparator;

public class PersonComparator implements Comparator<Person> {

    @Override
    public int compare(Person o1, Person o2) {
        if(o1.getAge() >= o2.getAge()){
            return 1;
        }else {
            return -1;
        }
    }
}
